[patch] Add FreeBSD platform support - #87
Conversation
| case "linux": | ||
| return fmt.Sprintf("libonnxruntime.so.%s", onnxRuntimeVersion) | ||
| case "freebsd": | ||
| return fmt.Sprintf("libonnxruntime.so") |
There was a problem hiding this comment.
by you using libonnxruntime.so here you make it so gowall uses the shared library that your system has available that you have installed by your package manager.
I don't want to do that, gowall downloads the shared library and places it inside ~/.u2net or whatever you have configured in the config.yml like OnnxRuntimeFolderPath: "~/.mycustomfolder".
Also i want to pin shared library to a specific version i download. Change it to
return fmt.Sprintf("libonnxruntime.so.%s", onnxRuntimeVersion)There was a problem hiding this comment.
The FreeBSD package will depend on ONNX by default, so it will be available in the system.
The last time I've checked, onnxRuntimeVersion was not in-sync with the FreeBSD package of onnxRuntime. So, I think it's better to remove it completely here for FreeBSD.
| func CheckOnnxRuntimeInstalled() (string, error) { | ||
| destFolder := config.GowallConfig.OnnxRuntimeFolderPath | ||
| if runtime.GOOS == "freebsd" { | ||
| destFolder = filepath.Join("/usr/local", "lib") |
There was a problem hiding this comment.
Same thing here you trying to get the onnx shared lib from /usr/local while i want to download it manually, so a user doesnt have to download it with their package manager and works everywhere for every platform.
Remove this
There was a problem hiding this comment.
I believe they don't ship binaries for FreeBSD platform, so I use package versions of them in FreeBSD.
|
|
||
| func (p *UpscaleProcessor) Process(img image.Image, theme string, format string) (image.Image, types.ImageMetadata, error) { | ||
| destFolder := filepath.Join(config.GowallConfig.OutputFolder, "upscaler") | ||
| if runtime.GOOS == "freebsd" { |
|
Hey @hpesojxn i'm more than happy to merge this as long as you make it so it doesn't read from the (essentially just copy the way i did with linux) |
|
Hey! Thanks for the quick feedback!
I believe neither of the downloadable URLs have a binary shipped especially for FreeBSD so I use the system-package way.
|
|
@hpesojxn What about this ? : https://pkg.freebsd.org/FreeBSD:14:amd64/latest/All/onnxruntime-1.25.1.pkg inside it has something that if you extract it you have : That's i want to download and place them in a folder and pin stable versions. Maybe we should use the https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly This doesnt guarantee that this version will always be available unlike the windows,macos,linux versions but it doesnt change every couple of weeks when another onxx version releases and its more stable |
|
I think people on FreeBSD would prefer the package/port version than installing gowall manually. So, I am thinking it about ports-wise first. I think it would be hard to keep up with the different onnx versions on FreeBSD, or, I can do something like, "learn current onnx version and replace it with what's specified in gowall code, i.e 1.25.4". There are some discussions here if it would be helpful: |
Hi,
I'd like to upstream the patches that used for successfully building
gowallfor FreeBSD platform. They would make the packaging process easier on FreeBSD.I have little to no programming knowledge, but tried my best doing the patches. I'd like to know if you could think of a better way to integrate support for FreeBSD.
They will make packaging process easier on FreeBSD.
Thanks in advance.